<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="./css/weibo.css" rel="stylesheet">
<title>所有文章</title>
</head>
<body>
	<div id="all-weibo">
		<div id="weibo-header">
			<img alt="头像" class="img-circle center-block" id="mine-img" src="./uploads/${currentUser.filename}"/>
			<h2>${currentUser.username}，欢迎你登录微博</h2>
		</div>
		<div id="weibo-write">
			<form action="./add.do" method="post">
				标题：<input type="text" name="title" id="title-add"/>
				<br>
				<span>内容：</span><textarea rows="5" name="content" id="textarea-add"></textarea>
				<input type="submit" id="btn-css" value="提交"/>
			</form>
		</div>
		<div id="weibo-mesg">
			<!-- <div id="weibo-bar"></div> -->
			<c:forEach var="t" items="${articles}">
				<div id="wei-all">
					<div id="wei-left">
						<img alt="头像" class="img-circle center-block" src="./uploads/${currentUser.filename}"/>
					</div>
					<div id="wei-right">
						<div id="wei-part1">
							<div id="wei-name"><h4>${currentUser.username}</h4></div>
							<div id="wei-time">${t.publishDate}</div>
						</div>
						<div id="wei-part2">
							<div id="wei-title"><h2>${t.title}</h2></div>
							<div id="wei-content"><h3>${t.content}</h3></div>
						</div>
						<div id="wei-del"><a href="./del.do?id=${t.id}">删除</a></div>
					</div>
				</div>
			</c:forEach>
		</div>
			
		
	
		<div id="weibo-next">
			<ul class="pagination">
				<li>
					<a href="./list.do?page=${current - 1}"><span aria-hidden="true">&laquo;</span></a>
				</li>
				<c:if test="${current <= 4}">
					<c:forEach var="num" begin="0" end="8">
						<li class="${num == current ? 'active' : ''}">
							<a href="./list.do?page=${num}">${num}</a>
						</li>
					</c:forEach>	
					<li><a>...</a></li>
					<li>
						<a href="./list.do?page=${total}">${total}</a>
					</li>	
				</c:if>
				
				<c:if test="${(4 < current) && (current < total-4)}">
					<li><a>...</a></li>
					<c:forEach var="num" begin="${current-4 }" end="${current+4 }">
						<li class="${num == current ? 'active' : ''}">
							<a href="./list.do?page=${num}">${num}</a>
						</li>
					</c:forEach>	
					<li><a>...</a></li>
					<li>
						<a href="./list.do?page=${total}">${total}</a>
					</li>	
				</c:if>
				
				<c:if test="${(total-4 <= current) && (current <= total)}">
					<li><a>...</a></li>
					<c:forEach var="num" begin="${current-4 }" end="${total }">
						<li class="${num == current ? 'active' : ''}">
							<a href="./list.do?page=${num}">${num}</a>
						</li>
					</c:forEach>
				</c:if>
				
	
			    <li>
			      <a href="./list.do?page=${current + 1}" aria-label="Next">
			        <span>&raquo;</span>
			      </a>
			    </li>
			</ul>
		</div>
	</div>
</body>
</html>






























